from torque.invite.models import Invite
from django import forms

class InviteCreationForm(forms.ModelForm):
    """   
    A form that creates invites for users.
    """
    class Meta:
	model = Invite
    
    def save(self, commit=True):
        invite = super(InviteCreationForm, self).save(commit=False)
        invite.send_invite()
        if commit:
            invite.save()
        return invite
